package config

/**
 * @Author Administrator
 * @Description 储配置项
 * @Date 2023/8/2 21:41
 * @Version 1.0
 */

//
//  Config
//  @Description: 结构体来存储配置项

type Config struct {
	Server   ServerConfig   `yaml:"server" json:"server"`
	Database DatabaseConfig `yaml:"database" json:"database"`
	Redis    RedisConfig    `yaml:"redis" json:"redis"`
	Upload   UploadConfig   `yaml:"upload" json:"upload"`
	Logs     Logs           `yaml:"logs"json:"logs"`
}

//
//  ServerConfig
//  @Description: 服务器配置

type ServerConfig struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
}

//
//  DatabaseConfig
//  @Description: 数据库配置

type DatabaseConfig struct {
	Dns      string `yaml:"dns"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

//
//  RedisConfig
//  @Description: Redis配置

type RedisConfig struct {
	DbIndex  int    `yaml:"dbIndex"`
	Password string `yaml:"password"`
}

//
//  UploadConfig
//  @Description: 文件上传的路径配置
//

type UploadConfig struct {
	SavePath string `yaml:"savePath"`
}

type Logs struct {
	Status   bool   `yaml:"status"`
	BaseLog  string `yaml:"baseLog"`
	SavePath string `yaml:"savePath"`
}
